* s~\t+$~~
[lhc/web/wiklou.git] / maintenance / rebuildInterwiki.inc
index 48db503..d2c2297 100644 (file)
@@ -50,7 +50,7 @@ function getRebuildInterwikiSQL() {
 
        # List of all database names
        $dblist = array_map( "trim", file( "/home/wikipedia/common/all.dblist" ) );
-       
+
        # Special-case hostnames
        $specials = array(
                'sourceswiki' => 'sources.wikipedia.org',
@@ -116,13 +116,13 @@ function getRebuildInterwikiSQL() {
                        } else {
                                $local = 0;
                        }
-                       
+
                        if ( empty( $reserved[$prefix] ) ) {
                                $iwArray[$prefix] = array( "iw_prefix" => $prefix, "iw_url" => $url, "iw_local" => $local );
                        }
                }
        }
-       
+
        $sql = "-- Generated by rebuildInterwiki.php";
 
 
@@ -130,14 +130,14 @@ function getRebuildInterwikiSQL() {
                if ( isset( $specials[$db] ) ) {
                        # Special wiki
                        # Has interwiki links and interlanguage links to wikipedia
-                       
+
                        $host = $specials[$db];
                        $sql .= "\n--$host\n\n";
                        $sql .= "USE $db;\n" .
                                        "TRUNCATE TABLE interwiki;\n" .
                                        "INSERT INTO interwiki (iw_prefix, iw_url, iw_local) VALUES \n";
                        $first = true;
-                       
+
                        # Intermap links
                        foreach ( $iwArray as $iwEntry ) {
                                $sql .= makeLink( $iwEntry, $first, $db );
@@ -147,7 +147,7 @@ function getRebuildInterwikiSQL() {
                        foreach ( $sites as $targetSite ) {
                                $sql .= makeLink( array( $targetSite->lateral, $targetSite->getURL( 'en' ), 1 ), $first, $db );
                        }
-                       
+
                        # Interlanguage links to wikipedia
                        $sql .= makeLanguageLinks( $sites['wiki'], $first, $db );
 
@@ -155,7 +155,7 @@ function getRebuildInterwikiSQL() {
                        foreach ( $extraLinks as $link ) {
                                $sql .= makeLink( $link, $first, $db );
                        }
-                       
+
                        $sql .= ";\n";
                } else {
                        # Find out which site this DB belongs to
@@ -174,7 +174,7 @@ function getRebuildInterwikiSQL() {
                        $lang = $matches[1];
                        $host = "$lang." . $site->url;
                        $sql .= "\n--$host\n\n";
-                       
+
                        $sql .= "USE $db;\n" .
                                        "TRUNCATE TABLE interwiki;\n" .
                                        "INSERT INTO interwiki (iw_prefix,iw_url,iw_local) VALUES\n";
@@ -206,7 +206,7 @@ function getRebuildInterwikiSQL() {
                        if ( $site->suffix == "wiki" ) {
                                $sql .= makeLink( array("w", "http://en.wikipedia.org/wiki/$1", 1), $first, $db );
                        }
-                       
+
                        # Extra links
                        foreach ( $extraLinks as $link ){
                                        $sql .= makeLink( $link, $first, $db );